package stack

import (
	"jvm/nzpJvm/instructions/base"
	"jvm/nzpJvm/runtime_area"
)
// 从操作数栈中弹出一个槽
type POP struct {
	base.NoOperandsInstruction
}

// 从栈中弹出两个槽位。用于double、long
type POP2 struct {
	base.NoOperandsInstruction
}

func (self *POP) Execute(frame *runtime_area.Frame) {
	frame.OperandStack().PopSlot()
}

func (self *POP2) Execute(frame *runtime_area.Frame) {
	stack := frame.OperandStack()
	stack.PopSlot()
	stack.PopSlot()
}